package cn.edu.gzgs.mapper;

import cn.edu.gzgs.entity.UserEducation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户-学历/学位关联Mapper
 * @author Zyf
 */
@Mapper
public interface UserEducationMapper extends BaseMapper<UserEducation> {

    /**
     * 批量插入用户学历/学位关联记录
     *
     * @param userEducationList 用户学历/学位关联列表
     */
    @Insert("""
            <script>
                INSERT INTO user_education (user_id, education_id) VALUES
                <foreach collection="userEducationList" item="item" separator=",">
                    (#{item.userId}, #{item.educationId})
                </foreach>
            </script>
            """)
    void batchInsert(@Param("userEducationList") List<UserEducation> userEducationList);
} 